﻿<?php
/**
 * 版本:酷享云支付3.0版
 * 作者：余生
 * 官网：www.kuxiangcms.com
 * 技术QQ：2316803263
 * 酷享云支付官网:pay.kuxiangcms.cn
**/
//后台登入
include("../includes/common.php");
$_GET     && SafeFilter($_GET);
$_POST    && SafeFilter($_POST);
$_COOKIE  && SafeFilter($_COOKIE);
if(isset($_POST['user']) && isset($_POST['pass'])){
	if(!$_SESSION['pass_error'])$_SESSION['pass_error']=0;
	$user=daddslashes($_POST['user']);
	$pass=daddslashes($_POST['pass']);
    $pass =  md5($pass.$password_hash."admin");
	if($_SESSION['pass_error']>5) {
		@header('Content-Type: text/html; charset=UTF-8');
		exit("<script language='javascript'>alert('用户名或密码不正确！');history.go(-1);</script>");
	}elseif($user==$conf['admin_user'] && $pass==$conf['admin_pwd']) {
		$city='';
        $DB->query("insert into `panel_log` (`uid`,`type`,`date`,`city`,`data`) values ('".$user."','登录管理后台','".$date."','".$city."','".$clientip."')");
		$session=md5($user.$pass.$password_hash);
		$token=authcode("{$user}\t{$session}", 'ENCODE', SYS_KEY);
		setcookie("admin_token", $token, time() + 3600);
		@header('Content-Type: text/html; charset=UTF-8');
		exit("<script language='javascript'>alert('登陆管理中心成功！');window.location.href='./';</script>");
	}elseif ($pass != $conf['admin_pwd']) {
		$_SESSION['pass_error']++;
		@header('Content-Type: text/html; charset=UTF-8');
		exit("<script language='javascript'>alert('用户名或密码不正确！');history.go(-1);</script>");
	}
}elseif(isset($_GET['logout'])){
	setcookie("admin_token", "", time() - 3600);
	@header('Content-Type: text/html; charset=UTF-8');
	exit("<script language='javascript'>alert('您已成功注销本次登陆！');window.location.href='./login.php';</script>");
}elseif($islogin==1){
	exit("<script language='javascript'>alert('您已登陆！');window.location.href='./';</script>");
}
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" content="<?php echo $conf['copyright']?>">
    <link rel="stylesheet" href="./admin/css/bootstrap.css">
    <link rel="stylesheet" href="./admin/login/login.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css">
    <script src="./admin/js/jquery.js"></script>
    <script src="./admin/js/bootstrap.js"></script>
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><?php echo $conf['web_name']?>-管理登入</title>
</head>
<body>

    <div>
        <div class="be-content pren">

            <div class="ioc_text">
                <img src="/template/moban1/kuyun/image/logo.png" alt="">
                <span>请登录您的管理账号</span>
            </div>

            <div>
                <form action="./login.php" method="post" role="form">
                    <div class="br-content">

                         <div class="input-group mb-4 bootint">
                             <div class="input-group-prepend">
                                 <span class="input-group-text"><i class="fa fa-user"></i></span>
                             </div>
                             <input type="text" class="form-control" name="user" placeholder="请输入管理员账号" value="<?php echo @$_POST['user'];?>" required="required">
                         </div>

                         <div class="input-group mb-4 bootint">
                             <div class="input-group-prepend">
                                 <span class="input-group-text"><i class="fa fa-unlock-alt"></i></span>
                             </div>
                             <input type="password" class="form-control" name="pass" placeholder="请输入管理员密码" required="required">
                         </div>

                        <div class="br-text">
                        </div>
                        <div style="padding-top: 10px">
                            <input type="submit" class="btn" value="登录">
                        </div>
                        <div class="be-con">
                            <span>Copyright © 2018 - 2019 余生网络</span>
                        </div>
                    </div>
                </form>
            </div>

        </div>
    </div>
 
  <!--请勿盗卖酷享云支付源码程序 ，如发现盗卖将不提供更新服务，系统由余生网络信息提供技术服务-->
